// Package factories 存放工厂方法
package factories

import (
	"github.com/bxcodec/faker/v4"
	"github.com/runningwater/gohub/app/models/user"
)

func MakeUsers(times int) []user.User {
	var objs []user.User

	// 设置唯一值
	faker.SetGenerateUniqueValues(true)

	for range times {
		model := user.User{
			Name:     faker.Username(),
			Email:    faker.Email(),
			Phone:    faker.Phonenumber(),
			Password: faker.Password(),
		}
		objs = append(objs, model)
	}
	return objs
}
